package com.wonders.hs.pd.mm.web.utils;

import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.IOException;
import java.util.Properties;

/**
 * @author banglong
 * @date 2016/8/18.
 */
public class PropertiesUtils {

  /**
   * 读取配置文件的属性
   *
   * @param fileName 文件名称
   * @param key      属性key
   */
  public static String getProperty(String fileName, String key) {
    String api_address = "";
    try {
      Properties config = PropertiesLoaderUtils.loadAllProperties(fileName);
      api_address = config.getProperty(key);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return api_address;
  }
}
